package com.weimai.message.gateway.controller;

import com.weimai.message.gateway.anno.RouteHandler;
import com.weimai.message.gateway.anno.RouteMapping;
import com.weimai.message.gateway.anno.RouteMethod;
import com.weimai.message.gateway.model.ReplyObj;
import com.weimai.message.gateway.utils.HttpUtil;
import io.vertx.core.Handler;
import io.vertx.ext.web.RoutingContext;

import static java.net.HttpURLConnection.HTTP_OK;

/**
 * Copyright (c) 2018 Choice, Inc.
 * All Right Reserved.
 * Choice Proprietary and Confidential.
 *
 * @Author geer
 * @Since 2018/11/11
 * @Version 1.0
 **/
@RouteHandler()
public class HealthCheckController {
    
    @RouteMapping(value = "/check", method = RouteMethod.GET)
    public Handler<RoutingContext> check() {
        return event -> {
            HttpUtil.fireJsonResponse(event.response(), HTTP_OK, ReplyObj.build().setMessage("success").setData("true"));
        };
    }
}
